package com.wnxy.sddfp.search.model.vo;


import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.math.BigDecimal;

// 指定索引库名称是：sddf_trade
@Document(indexName = "sddf_trade")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class BorrowVO {

    @Id
    private String id;

    /**
     * 借款名称，type指定数据类型； analyzer指定分词器类型
     */
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String name;

    /**
     * 金额
     */
    @Field(type = FieldType.Double)
    private BigDecimal amount;

    /**
     * 借款期限(单位:天)
     */
    @Field(type = FieldType.Integer)
    private Integer period;

    /**
     * 借款描述
     */
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String description;

    /**
     * 状态
     */
    @Field(type = FieldType.Keyword,name = "status")
    private String status;
}